#include <stdio.h>
#include <iostream>
#include <vector>
using namespace std;

typedef long long llt;

struct Point {
    llt x;
    llt y;
    Point(llt a=0, llt b=0):x(a),y(b){}
    llt cross(const Point & A, const Point & B) const {
        llt xoa = A.x - x, yoa = A.y - y;
        llt xob = B.x - x, yob = B.y - y;
        return xoa * yob - xob * yoa;
    }
    llt cross(const Point & r) const {
        return x * r.y - y * r.x;
    }
    const Point operator - (const Point & r) const {
        return Point(x - r.x, y - r.y);
    } 
};

int N;
llt S;
vector<llt> D;
vector<llt> F;
vector<llt> T;
vector<int> Q;

const Point get(int p){
    return Point(F[p], D[p] - S * F[p]);
}

void work(){    
    D.assign(N + 1, 0);
    F.assign(N + 1, 0);
    T.assign(N + 1, 0);
    for(int t,f,i=1;i<=N;++i){
        cin >> t >> f;
        T[i] = T[i - 1] + t;
        F[i] = F[i - 1] + f;
    }

    Q.assign(N + 1, 0);
    vector<int>::iterator bot = Q.begin();
    vector<int>::iterator top = bot;

    for(int i=1;i<=N;++i){
        const Point now(1LL, T[i]);
        while(bot < top and now.cross(get(*(bot + 1)) - get(*bot)) <= 0){
            bot += 1;
        }
        D[i] = D[*bot] + T[i] * (F[i] - F[*bot]) + S * (F[N] - F[*bot]);
        while(bot < top and get(*(top - 1)).cross(get(*top), get(i)) <= 0){
            top -= 1;
        }
        *++top = i;
    }

    cout << D[N] << "\n";
    return;
}

int main(){
#ifndef ONLINE_JUDGE
    freopen("z.txt", "r", stdin);
#endif
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int nofkase = 1;
    // cin >> nofkase;
    while(cin >> N >> S) work();
    return 0;
}
